InstancingΒΆ
It is possible to instanciate objects in the scene using the RenderGraph, such as simple primitives, lights and more complex hierarchies.
Instancing Objects
It is possible to add primitives directly using the RenderGraph.
In the RenderGraph view:
- Press Ctrl+Space to open the node picker
- Enter Cube
- Connect the Cube node to the graph
In the RenderGraph view:
- Press Ctrl+Space to open the node picker
- Enter Cube
- Connect the Cube node to the graph
- Connect a Path node to the Parent input
When parented to multiple nodes, the primitive will be instanced multiple times.
Instancing Scene Graph Nodes
More generally, you can instanciate scene hierarchies using the RenderGraph SceneGraph node.
In the RenderGraph view:
- Press Ctrl+Space to open the node picker
- Enter SceneGraph
- Connect the SceneGraph node to the graph
You can proceed to add new nodes to the hierarchy by double-clicking into the SceneGraph node. This hierarchy can be freely parented to another or multiple other scene nodes, using the Parent input.
Instancing Lights
Similarly, you can spawn lights directly using the RenderGraph. This is an alternative to creating lights directly in the scene graph, and is a convenient way to pack a lighting setup into a single RenderGraph.
In the RenderGraph view:
- Press Ctrl+Space to open the node picker
- Enter a light name from the library ("PointLight", for instance)
- Press Enter
When connected to the graph, the light will be added to the scene. When provided a Parent, the light may be instanciated multiple times in the scene. Without parenting, the light is added to the root of the scene.
Instancing Scene Graph pieces
It is possible to enrich the scene graph using the render graph by spawning
scene nodes. For instance, you can create instances of a part of the scene graph
using the
In the RenderGraph view:
- Press Ctrl+Space to open the node picker
- Enter Spawn and select the SpawnNode
- Set the
Spawn > Spawn Child attribute to the path of the child node to spawn.
Connect RenderGraph inputs to the Parent input to specify at which point of the scene graph the child will be spawned. This allows you to to instanciate the node in different locations.
When left unconnected, the Parent input of the Spawn node will spaw the child directly at the root of the scene.
In the RenderGraph view:
- Press Ctrl+Space to open the node picker
- Enter Spawn and select the Spawn node
- Set the
Spawn > Spawn Child attribute to the path of the child node to spawn. - Drag and drop the instance location into the RenderGraph, and connect the Path node to the Parent input.
In the Node List, click the Toggle Live SceneGraph to display the scene graph with spawned nodes. In this mode, only SceneGraph nodes are displayed, and the nodes can not be moved or reparented.